package checkNetwork;

import com.example.manager.ResourcesManager;

import android.app.Activity;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;

public class network extends Activity {
	
	public static boolean chkStatus() {
	    boolean connected = false;
	    ConnectivityManager cm = (ResourcesManager.getInstance().activity.getManagerNetwork());
	    if (cm != null) {
	        NetworkInfo[] netInfo = cm.getAllNetworkInfo();

	        for (NetworkInfo ni : netInfo) {
	            if ((ni.getTypeName().equalsIgnoreCase("WIFI")
	                    || ni.getTypeName().equalsIgnoreCase("MOBILE"))
	                    && ni.isConnected() && ni.isAvailable()) {
	                connected = true;
	            }
	        }
	    }

	    return connected;
	
}
}
